<template>
  <div class="dashboard-container">
    <div class="dashboard-text">姓名: {{ temp.realName }}</div>
    <div class="dashboard-text">性别: {{ temp.gender }}</div>
    <div class="dashboard-text">年龄: {{ temp.age }}</div>
    <div class="dashboard-text" v-if="temp.roleId!=8">职位: {{ temp.roleName }}</div>
    <div class="dashboard-text" v-if="temp.roleId!=8">科室: {{ temp.name }}</div>
    <div class="dashboard-text">电话: {{ temp.telephone }}</div>

  </div>
</template>

<script>
import { getUserMsg } from '@/api/user'

export default {
  name: 'Dashboard',
  data (){
    return {
      temp: {
        roleId:'',
        // account: '',
        realName: '',
        gender: '',
        age: '',
        roleName: '',
        name: '',
        telephone: ''
      }
    }
  },
  methods:{
    getUser(){
      getUserMsg().then(res=>{
        this.temp=res.content
      }).catch(err => {
        console.log(err)
      })
    }
  },
  mounted() {
    this.getUser()
  }


}

</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
